package com.wish.blessingroad.common;

/**
 * @author donghaocheng
 * @date 2019年2月20日 下午9:05:45
 * @version 1.0
 * @throws
 * @see
 */
public enum ErrorStatus {

    /**
     * default service exception
     */
    DEFAULT_SERVICE_EXCEPTION(10000, "default service exception!"),

    EC_BUSINESS_PARAMS_REQUIRED(20099,"params is required"),

    /**
     * return error
     */
    RETURN_ERROR(10001,"return error"),


    /**
     * 操作频繁
     */
    OP_FREQUENT(26001,"operation frequent");




    /**
     * http 状态码
     */
    private final int httpStatus;

    /**
     * 业务状态码
     */
    private final int code;

    /**
     * 状态信息
     */
    private final String message;

    private ErrorStatus(int httpStatus, int code, String message) {
        this.httpStatus = httpStatus;
        this.code = code;
        this.message = message;
    }

    private ErrorStatus(int code, String message) {
        this.httpStatus = 200;
        this.code = code;
        this.message = message;
    }

    /**
     * Return the integer value of this httpStatus.
     */
    public int httpStatus() {
        return this.httpStatus;
    }

    /**
     * Return the integer value of this code.
     */
    public int code() {
        return this.code;
    }

    /**
     * Return the advice of this status code.
     */
    public String message() {
        return this.message;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
